#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    long long countCompleteDayPairs(vector<int>& hours) {
        long long time[24] = { 0 };
        int n = hours.size();
        long long res = 0;
        for (int i = 0; i < n; i++)
        {
            int rev = 24 - (hours[i] % 24);
            if (rev == 24) rev = 0;
            res += time[rev];
            time[hours[i] % 24]++;
        }
        return res;
    }
};